<html>
	<body>
		<style type="text/css">
			{literal}
			.hint{
				font-size: xx-small;
				margin-left: 20px;
			}
			{/literal}
		</style>
		<form name="file_form" action="{$URL_ROOT}file/upload/load" method="post" enctype="multipart/form-data">
			<input name="filename" type="hidden" value="{$filename}"/>
			<input name="field" type="hidden" value="{$field}"/>
			<input name="width" type="hidden" value="{$width}"/>
			<input name="height" type="hidden" value="{$height}"/>
			<input name="max_size" type="hidden" value="{$max_size}"/>
			<input name="uploaded_function" type="hidden" value="{$uploaded_function}"/>
			<input name="file" type="file" onchange="form.submit();"/>{if "" != $width && "" != $height}<span class="hint">{__ t='Will resize to '}{$width}px X {$height}px</span>{/if}
		</form>
		{if isset($uploaded_file) && !empty($uploaded_file) }
			<script type="text/javascript">
				try{ldelim}
					parent.{$uploaded_function}('{$field}','{$uploaded_file}');
				{rdelim}catch(e){ldelim}
					alert("{__ t="You probably forgot to implement the file_uploaded function"}\n"+e.message);
				{rdelim}
			</script>
		{/if}
	</body>
</html>